const fn = () => {
    console.log(this);
};

function fn1 () {
    console.log(this);
}

fn(); // window

const obj = {
    a: 1,
    fn,
    f1: () => {
        console.log(this);
    },
};

class C {
    f2 = () => {
        console.log(this);
    }
    f3 () {
        console.log(this);
    }
    f4 = fn;
    f5 = fn1;
}

obj.fn(); // window
obj.f1(); // window

const instance = new C();
instance.f2(); // instance
instance.f3(); // instance
instance.f4(); // window
instance.f5(); // instance
